﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using socialnexus.classes.pages;
using socialnexus.classes.models;

namespace socialnexus
{
    public partial class RecordMessage : AuthenticatedUserPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string friendId = Request.QueryString["FriendId"].ToString();
            txtFriendId.Text = friendId;

            SiteUser friend = SiteUser.GetById(friendId);
            imgFriend.ImageUrl = friend.PictureURL;
            lblFriendName.Text = friend.FirstName + " " + friend.LastName;
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            SiteUser su = GetUser();
            su.SendMessage(txtFriendId.Text, txtVideoURL.Text);
            Response.Redirect("~/Inbox.aspx");
        }
    }
}
